/*    */ package com.wzh.service.user;
/*    */ 
/*    */ import com.wzh.bean.user.UserInfo;
/*    */ import com.wzh.service.base.DaoSupport;
/*    */ import com.wzh.utils.MD5;
/*    */ import java.util.List;
/*    */ import javax.persistence.EntityManager;
/*    */ import javax.persistence.Query;
/*    */ import org.springframework.stereotype.Service;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ 
/*    */ @Service
/*    */ @Transactional
/*    */ public class UserServiceBean extends DaoSupport<UserInfo>
/*    */   implements UserService
/*    */ {
/*    */   public UserInfo find(String username, String password)
/*    */   {
/* 21 */     Query query = this.em.createQuery("select o from UserInfo o where o.username=?1 and o.password=?2");
/* 22 */     query.setParameter(1, username);
/* 23 */     query.setParameter(2, MD5.MD5Encode(password));
/* 24 */     query.setMaxResults(1);
/* 25 */     List list = query.getResultList();
/* 26 */     if ((list != null) && (list.size() > 0)) {
/* 27 */       return (UserInfo)list.get(0);
/*    */     }
/* 29 */     return null;
/*    */   }
/*    */ }

/* Location:           C:\work\apache-tomcat-7.0.55\webapps\ROOT\WEB-INF\classes\
 * Qualified Name:     com.wzh.service.user.UserServiceBean
 * JD-Core Version:    0.6.1
 */